{
  "settings": {
    "hasHeaders": true,
    "constrainDragToContainer": true,
    "reorderEnabled": true,
    "selectionEnabled": false,
    "popoutWholeStack": false,
    "blockedPopoutsThrowError": true,
    "closePopoutsOnUnload": true,
    "showPopoutIcon": false,
    "showMaximiseIcon": false,
    "showCloseIcon": false,
    "responsiveMode": "onload",
    "tabOverlapAllowance": 0,
    "reorderOnTabMenuClick": true,
    "tabControlOffset": 10
  },
  "dimensions": {
    "borderWidth": 5,
    "borderGrabWidth": 15,
    "minItemHeight": 10,
    "minItemWidth": 10,
    "headerHeight": 20,
    "dragProxyWidth": 300,
    "dragProxyHeight": 200
  },
  "labels": {
    "close": "close",
    "maximise": "maximise",
    "minimise": "minimise",
    "popout": "open in new window",
    "popin": "pop in",
    "tabDropdown": "additional tabs"
  },
  "content": [
    {
      "type": "row",
      "isClosable": true,
      "reorderEnabled": true,
      "title": "",
      "content": [
        {
          "type": "stack",
          "width": 53.827311696264545,
          "isClosable": true,
          "reorderEnabled": true,
          "title": "",
          "activeItemIndex": 0,
          "content": [
            {
              "type": "component",
              "componentName": "codeEditor",
              "title": "* lever.json",
              "componentState": {
                "code": [
                  "// CascadeStudio Code to create a forked lever ",
                  "// inspired by ModelMania shape 2010 and ",
                  "// exercise created by JokoEngineering ",
                  "",
                  "let t1                  = 8;",
                  "let t2                  = 10;",
                  "let t3                  = 2;",
                  "let sep                 = 30;",
                  "",
                  "let radius_1            = 30;",
                  "let radius_2            = 12;",
                  "let distance            = 120;",
                  "let wall_thickness      = 5;",
                  "let lever_height        = sep + (4*t1); ",
                  "let fillet_cutout       = 5;",
                  "let fillet_outer        = 1;",
                  "let fillet_arms         = 5;",
                  "let depth               = lever_height + fillet_cutout;",
                  "let chamfer             = 1;",
                  "",
                  "function Lever(radius1, radius2, distance, leverheight, wall_thickness)",
                  "{",
                  "    let sinus_angle = (radius1 - radius2) / distance",
                  "    let angle = Math.asin(sinus_angle);",
                  "",
                  "    // points of outer contour of the lever",
                  "    let p1 = [radius1 * Math.sin(angle), radius1 * Math.cos(angle)];",
                  "    let p2 = [distance + radius2 * Math.sin(angle), radius2 * Math.cos(angle)];",
                  "    let p3 = [distance + radius2, 0];",
                  "    let p4 = [distance + radius2 * Math.sin(angle), - radius2 * Math.cos(angle)];",
                  "    let p5 = [radius1 * Math.sin(angle), - radius1 * Math.cos(angle)];",
                  "    let p6 = [- radius1, 0 ];",
                  "",
                  "    let sketchLever = new Sketch(p1).",
                  "                    LineTo(p2).",
                  "                    ArcTo(p3,p4).",
                  "                    LineTo(p5).",
                  "                    ArcTo(p6,p1).",
                  "                    End(false).Face(true);",
                  "              ",
                  "    let leverbody = Extrude(sketchLever,[0,0,leverheight]);",
                  "  ",
                  "    let big_hole = Cylinder((radius1-wall_thickness), 2* (leverheight + 10), true);",
                  "    let small_hole =  Translate([distance, 0,0 ], Cylinder((radius2-wall_thickness), 2* (leverheight + 10), true));",
                  "    let lever = Difference(leverbody,[big_hole, small_hole]);",
                  "    return lever",
                  "}",
                  "",
                  "function Cutout(radius1, radius2, distance, leverheight, wall_thickness,depth)",
                  "{",
                  "// points of outer contour of the lever",
                  "    let sinus_angle = (radius1 - radius2) / distance",
                  "    let angle = Math.asin(sinus_angle);",
                  "",
                  "    distance = distance + 2*wall_thickness;",
                  "",
                  "    let c1 = [radius1 * Math.sin(angle), radius1 * Math.cos(angle)];",
                  "    let c2 = [distance + radius2 * Math.sin(angle), radius2 * Math.cos(angle)];",
                  "    let c3 = [distance - radius2 , 0];",
                  "    let c4 = [distance + radius2 * Math.sin(angle), - radius2 * Math.cos(angle)];",
                  "    let c5 = [radius1 * Math.sin(angle), - radius1 * Math.cos(angle)];",
                  "    let c6 = [radius1, 0 ];",
                  "",
                  "let cutout  = new Sketch(c1).",
                  "                     LineTo(c2).",
                  "                     ArcTo(c3,c4).",
                  "                     LineTo(c5).",
                  "                     ArcTo(c6,c1).",
                  "                     End(false).Face(true);",
                  "    ",
                  "cutoutBody = Extrude(cutout,[0,0,leverheight+4*wall_thickness]);",
                  "cutoutBody = Translate([-wall_thickness,0,leverheight-wall_thickness-depth],cutoutBody);",
                  "cutoutBody = Offset(cutoutBody,-wall_thickness);",
                  "return cutoutBody;    ",
                  "}",
                  "",
                  "function RoundAll(shape,fillet)",
                  "{",
                  "    let shrunk_version = Offset(shape,-fillet)",
                  "    let grown_version = Offset(shrunk_version, fillet)",
                  "    return grown_version",
                  "}",
                  "",
                  "function SideView(radius1,radius2,distance,sep,t1,t2,t3)",
                  "{",
                  "    // sketch upper half",
                  "    let p1 = [-radius1-t3,sep/2];",
                  "    let p2 = [-radius1-t3,sep/2+t1];",
                  "    let p3 = [radius1+t3,sep/2+t1];",
                  "    let p4 = [distance-radius2-t3,t2/2];",
                  "    let p5 = [distance+radius2+t3,t2/2];",
                  "    let p6 = [distance+radius2+t3,t2/2-t1]; ",
                  "    let p7 = [distance-radius2-t3,t2/2-t1];",
                  "    let p8 = [radius1+t3,sep/2];",
                  "    let p9 = [-radius1-t3,sep/2];",
                  "    ",
                  "    let halfUpper = new Sketch(p1)",
                  "    .LineTo(p2)",
                  "    .LineTo(p3)",
                  "    .LineTo(p4)",
                  "    .LineTo(p5)",
                  "    .LineTo(p6)",
                  "    .LineTo(p7)",
                  "    .LineTo(p8)",
                  "    .LineTo(p9)",
                  "    .End(false)",
                  "    .Face(true);",
                  "    return halfUpper",
                  "}",
                  "",
                  "",
                  "// Rollback stack",
                  "let lever           = Lever(radius_1,radius_2,distance,lever_height,wall_thickness);",
                  "let cutoutShape     = Cutout(radius_1, radius_2, distance, lever_height, wall_thickness,depth);",
                  "let cutoutShape1    = RoundAll(cutoutShape,fillet_cutout)",
                  "lever               = Difference(lever,[cutoutShape1]);",
                  "let sideviewUpper   = SideView(radius_1,radius_2,distance,sep,t1,t2,t3);",
                  "sideviewUpper       = Translate([0,0,-radius_1],Extrude(sideviewUpper,[0,0,radius_1*2]));",
                  "sideviewLower       = Rotate([1,0,0],180,sideviewUpper,true);",
                  "let sideviewComplete = Union([sideviewUpper,sideviewLower],false,0.1,false);",
                  "sideviewComplete    = FilletEdges(sideviewComplete,fillet_cutout,[22]);",
                  "sideviewComplete    = Rotate([1,0,0],90,sideviewComplete);",
                  "sideviewComplete    = Translate([0,0,sep/2+t1],sideviewComplete);",
                  "let fork            = Intersection([lever,sideviewComplete]);",
                  "fork                = FilletEdges(fork,fillet_arms,[69,71,45,48,36,40,19,15,31,25,55],false);",
                  "fork                = FilletEdges(fork,fillet_arms,[83],false);",
                  "fork                = FilletEdges(fork,fillet_outer,[19,12,23],false);",
                  "fork                = ChamferEdges(fork,chamfer,[35,209,219,224],false);",
                  "",
                  "",
                  ""
                ]
              },
              "width": 50,
              "isClosable": false,
              "reorderEnabled": true
            }
          ]
        },
        {
          "type": "column",
          "isClosable": true,
          "reorderEnabled": true,
          "title": "",
          "width": 46.172688303735455,
          "content": [
            {
              "type": "stack",
              "height": 80,
              "isClosable": true,
              "reorderEnabled": true,
              "title": "",
              "activeItemIndex": 0,
              "content": [
                {
                  "type": "component",
                  "componentName": "cascadeView",
                  "title": "CAD View",
                  "componentState": {
                    "componentName": "cascadeView",
                    "MeshRes": 0.1,
                    "MeshResRange": [
                      0.01,
                      2
                    ],
                    "Cache?": false,
                    "Radius": 30,
                    "RadiusRange": [
                      20,
                      40
                    ]
                  },
                  "isClosable": false,
                  "reorderEnabled": true
                }
              ]
            },
            {
              "type": "stack",
              "height": 20,
              "isClosable": true,
              "reorderEnabled": true,
              "title": "",
              "activeItemIndex": 0,
              "content": [
                {
                  "type": "component",
                  "componentName": "console",
                  "title": "Console",
                  "componentState": {},
                  "height": 20,
                  "isClosable": false,
                  "reorderEnabled": true
                }
              ]
            }
          ]
        }
      ]
    }
  ],
  "isClosable": true,
  "reorderEnabled": true,
  "title": "",
  "openPopouts": [],
  "maximisedItemId": null
}